package com.ruoyi.points.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.points.mapper.CommunityPointsLogMapper;
import com.ruoyi.points.domain.CommunityPointsLog;
import com.ruoyi.points.service.ICommunityPointsLogService;

/**
 * 积分流水记录Service业务层处理
 * 
 * @author xianyu
 * @date 2025-04-03
 */
@Service
public class CommunityPointsLogServiceImpl implements ICommunityPointsLogService 
{
    @Autowired
    private CommunityPointsLogMapper communityPointsLogMapper;

    /**
     * 查询积分流水记录
     * 
     * @param id 积分流水记录主键
     * @return 积分流水记录
     */
    @Override
    public CommunityPointsLog selectCommunityPointsLogById(Long id)
    {
        return communityPointsLogMapper.selectCommunityPointsLogById(id);
    }

    /**
     * 查询积分流水记录列表
     * 
     * @param communityPointsLog 积分流水记录
     * @return 积分流水记录
     */
    @Override
    public List<CommunityPointsLog> selectCommunityPointsLogList(CommunityPointsLog communityPointsLog)
    {
        return communityPointsLogMapper.selectCommunityPointsLogList(communityPointsLog);
    }

    /**
     * 新增积分流水记录
     * 
     * @param communityPointsLog 积分流水记录
     * @return 结果
     */
    @Override
    public int insertCommunityPointsLog(CommunityPointsLog communityPointsLog)
    {
        communityPointsLog.setCreateTime(DateUtils.getNowDate());
        return communityPointsLogMapper.insertCommunityPointsLog(communityPointsLog);
    }

    /**
     * 修改积分流水记录
     * 
     * @param communityPointsLog 积分流水记录
     * @return 结果
     */
    @Override
    public int updateCommunityPointsLog(CommunityPointsLog communityPointsLog)
    {
        return communityPointsLogMapper.updateCommunityPointsLog(communityPointsLog);
    }

    /**
     * 批量删除积分流水记录
     * 
     * @param ids 需要删除的积分流水记录主键
     * @return 结果
     */
    @Override
    public int deleteCommunityPointsLogByIds(Long[] ids)
    {
        return communityPointsLogMapper.deleteCommunityPointsLogByIds(ids);
    }

    /**
     * 删除积分流水记录信息
     * 
     * @param id 积分流水记录主键
     * @return 结果
     */
    @Override
    public int deleteCommunityPointsLogById(Long id)
    {
        return communityPointsLogMapper.deleteCommunityPointsLogById(id);
    }
}
